<h1><%= _('Listing recipients') %></h1>


<% form_tag({ :action => 'list' }, :method => :get) do %>
  <%= image_tag('search.png', :border=>0, :alt=>_("search")) %>
  <input type="text" name="search" value="<%= @search %>" size="30"/><%= submit_tag _('Search') %>
<% end %>


<table>
  <tr>
    <th><%= _('Email') %></th>
    <th><%= _('Name') %></th>
    <th><%= _('Subscriptions') %></th>
    <th><%= _('Date Added') %></th>
  </tr>
  
<% @recipients.each do | recipient | %>
  <tr>
    <td><%=h recipient.send(:email) %></td>
    <td><%= recipient.full_name %></td>
    <td><%= recipient.subscriptions.size %></td>
    <td><%=h recipient.created_on %></td>
    <td><%= link_to(image_tag("Show.png", :border => 0, :title => _("show")), :action => 'show', :id => recipient) %></td>
    <td><%= link_to(image_tag("edit.png", :border => 0, :title => _("edit")), :action => 'edit', :id => recipient) %></td>
    <td><%= link_to(image_tag("destroy.png", :border => 0, :title => _("destroy")), { :action => 'destroy', :id => recipient }, :confirm => _('Are you sure?'), :method => :post) %></td>
  </tr>
<% end %>
</table>

<%= page_selector(@recipient_pages, {:search => @search, :filter => @filter }) %>

<br />

<%= link_to(image_tag("new.gif", :border => 0, :title => _("New recipient")) +' '+_("New recipient"), :action => 'new') %>
| <%= link_to _('Projects'), :controller => 'projects', :action => 'list' %>
